package net.xdclass.xdvideo.controller;

import net.xdclass.xdvideo.config.WechatConfig;
import net.xdclass.xdvideo.domain.JsonData;
import net.xdclass.xdvideo.mapper.VideoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

	@Autowired
	private WechatConfig wechatConfig;

	@Autowired
	private VideoMapper videoMapper;

	@RequestMapping("test")
	public String test(){
		return "hello xdclass.net";
	}

	@RequestMapping("test_config")
	public JsonData testConfig(){
		System.out.println(wechatConfig.getAppId());
		return JsonData.buildSuccess(wechatConfig.getAppId());
	}

	@RequestMapping("test_db")
	public Object testDB(){
		return videoMapper.findAllVideo();
	}
	
}
